home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 June / CHIP 2005-06.iso / program / web / kmsetup.exe / {app} / Motion Scripts / Matrix / effect2.txt
Encoding:
Text File  |  2005-01-21  |  1.6 KB  |  60 lines

  1. // main_init function
  2.  
  3. main_init = function(mc){
  4.  col_width = 0;
  5.  box = function(mc,tl_x, tl_y, br_x, br_y, cf ){
  6.   mc.lineStyle();
  7.   mc.beginFill(cf);
  8.   mc.moveTo (tl_x,tl_y);
  9.   mc.lineTo (br_x,tl_y);
  10.   mc.lineTo (br_x,br_y);
  11.   mc.lineTo (tl_x,br_y);
  12.   mc.endFill();
  13.  }
  14.  random_letter = function(i){
  15.   o = new Object();
  16.   o._x = Math.floor(mc._width * (Math.random()-.5) / col_width) * col_width; 
  17.   o._y = Math.floor(mc._height * (Math.random()-.5)); 
  18.   o._alpha = 40 + Math.floor(Math.random() * 50); 
  19.   o._xscale = o._yscale = 50 + Math.floor(Math.random() * 40); 
  20.   $smc[Math.floor(Math.random()*$sub_cnt)].duplicateMovieClip("rmc"+i,-i,o);
  21.   clr = new Color($mmc["rmc"+i]);
  22.   clr.setRGB(letter_color); 
  23.  } 
  24.  subs_done = true;
  25.  for(i=0;i<$sub_cnt;i++) col_width = Math.max(col_width,$smc[i]._width);
  26.  col_width = col_width - $padding + colspace;
  27.  createEmptyMovieClip("mask",6);
  28.  mc.setMask(mask);
  29.  hh = Math.ceil((mc._height-$padding) / 2) + 10;
  30.  hw = Math.ceil((mc._width-$padding) / 2) + 10;
  31.  box(mask,-hw,-hh,hw,hh,0);
  32.  for(i=0;i<letters;i++){
  33.   random_letter(i);
  34.   if (start_blank) $mmc["rmc"+I]._xscale = 0; 
  35.  }
  36. }
  37.  
  38. // main_effect function
  39.  
  40. main_effect = function(mc,frame){
  41.  for(i=0;i<letters;i++){
  42.   rmc = $mmc["rmc"+i];
  43.   rmc._alpha-= alpha_decrease_speed;
  44.   rmc._y+= fall_speed;
  45.   if (((rmc._y - (rmc._height-$padding) / 2) > hh)||(rmc._alpha<1)) random_letter(i);
  46.  }  
  47. }
  48.  
  49. // sub_init function
  50.  
  51. sub_init = function(mc){
  52.  if(!text_visible) mc._alpha = 0;
  53. }
  54.  
  55. // sub_effect function
  56.  
  57. sub_effect = function(mc,frame){
  58. }
  59.  
  60.